<style lang='scss' scoped>
.plants-header {
  background: url(../../../static/img/power-heads.png) no-repeat;
  background-size: 100% 100%;
  height: 1rem;
  line-height: 1rem;
  text-align: center;
  font-size: 0.45rem;
  color: #fff;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 9999;
  .back-icon {
    position: absolute;
    left: 0.5rem;
    top: 0;
    line-height: 1rem;
    cursor: pointer;
    i {
      display: inline-block;
      width: 0.3rem;
      height: 0.5rem;
      background: url("../../../static/img/back-icon.png") no-repeat;
      background-size: 100% 100%;
      vertical-align: middle;
      margin-right: 0.375rem;
    }
    span {
      font-size: 0.7rem;
      color: #fff;
    }
  }
  .more-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    margin-top: -0.1rem;
    width: 1rem;
    height: 0.2rem;
    cursor: pointer;
  }
}
</style>
<template>
    <div class="plants-header">
        <div @click="goback" class="back-icon">
            <i></i>
        </div>
        {{title}}
    </div>
</template>
<script>
export default {
  props: ["theRouter"],
  data() {
    return {};
  },
  computed: {
    title: function() {
      return this.theRouter.matched[0].name;
    }
  },
  methods: {
    goback: function() {
      if (this.$route.path == "/infoaudit") {
        this.$router.push({ path: "/index" });
      }else{
        this.$router.go(-1);
        this.$emit("back");
      }
    }
  }
};
</script>
